package cn.mysource.controller;

import cn.mysource.dto.ProductDto;
import cn.mysource.service.IProductService;
import cn.mysource.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private IProductService productService;

    @PostMapping("add")
    public AjaxResult add(@RequestBody ProductDto productDto){
     return productService.add(productDto);


    }


}
